#ifndef SHADER_H
#define SHADER_H


void getGLVersion(int * major, int * minor) ;
void getGLSLVerstion(int * major, int * minor) ;

class Shader
{
public:
	Shader () ;
	Shader (const char * vp_source, const char * fp_source) ;
	void load(const char * vp_source, const char * fp_source) ;
	void bind();
	int get_uniform(const char * uniform_name) const;
	void set_uniform(const char * uniform_name, int i) const;
	void set_uniform(const char * uniform_name, float f) const;
	void set_uniform(const char * uniform_name, const float vector4[], unsigned size) const;

protected:
	
	int printOglError(char *file, int line);
	void printShaderInfoLog(GLuint obj);
	void printProgramInfoLog(GLuint obj);

	char * load_source(const char *fn);
	int textFileWrite(char *fn, char *s);

private:
	GLuint v,f,p;
} ;

#endif